Skip to content

Conversation

@jayzhenghan
Copy link
Contributor

No description provided.

ut/test.py Outdated

def test_download_file():
"""测试断点续传下载接口"""
client.download_file(test_bucket, test_object, 'test_download_file.local')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ut建议加上md5校验,确保下载的文件的正确性

return True

def download_file(self, Bucket, Key, DestFilePath, PartSize=20, MAZThread=5, EnableCRC=False, **Kwargs):
"""小于等于20MB的文件简单上传,大于20MB的文件使用分块上传
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注释不对

:param key(string): 分块上传路径名.
:param LocalFilePath(string): 本地文件路径名.
:param PartSize(int): 分块的大小设置,单位为MB.
:param MAXThread(int): 并发上传的最大线程数.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment

pool.wait_completion()
result = pool.get_result()
if not result['success_all']:
raise CosClientError('some upload_part fail after max_retry, please upload_file again')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check

@dt3310321
Copy link
Contributor

LGTM

@dt3310321 dt3310321 merged commit 49197ca into tencentyun:master Aug 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants